﻿using Jinjia.Approve.Model.VM.Org;
using Jinjia.Core.UnitOfWork.UnitOfWorkComponent;
using JinJia.Core.MQProvider;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;

namespace Jinjia.Approve.API.Config
{
    public static class ApiConfigManagement
    {
        public static void AddConfigOptions(this IServiceCollection services, IConfiguration configuration)
        {
            services.Configure<DbConfig>(configuration.GetSection(nameof(DbConfig)));
            services.Configure<ApprovePlatformConfig>(configuration.GetSection(nameof(ApprovePlatformConfig)));
            services.AddRabbitMQServiceWithConsumer(configuration.GetSection("Jinjia.Approve"), null);
        }
    }
}